#ifndef __MAIN__
#define __MAIN__

extern XDATA BYTE LVDSMode;
extern XDATA BYTE BrightnValue;
extern XDATA BYTE CanBrightData;

void TaskSetGrid(BYTE onoff);
BYTE TaskGetGrid(void);
void TaskSetGridCmd(BYTE cmd);
BYTE TaskGetGridCmd(void);

void DownLoadGamma(void);
void DetectCVBSSiganl(void);

void SetMAX9218WorkingRange(BYTE mode);
void SetMAX9218InputSignalSource(BYTE source);

void I2c_init(CODE_P	BYTE  *regset);
void SetLEDBacklightBrightness(BYTE duty);
void SetTW8825DisplayModule(BYTE mode);

void TW8825_Disable(void);


void TW8825_Enable(void);


#define TASK_CMD_DONE			0
#define TASK_CMD_WAIT_VIDEO		1
#define TASK_CMD_WAIT_MODE		2
#define TASK_CMD_RUN			3
#define TASK_CMD_RUN_FORCE		4

#define X_SW P3_3
#define RNG0 P3_4
#define RNG1 P3_5
#define I2C_EN P1_3

#define CarLVDSmode 0
#define BoxLVDSmode 1


#endif	// __MAIN__
